package com.jn.exam.webSocket.controller;

import com.jn.exam.R;
import com.jn.exam.webSocket.entity.StudentConnection;
import com.jn.exam.webSocket.service.ExamService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author 江南大学1033190417
 * @date 2022/3/4 21:21
 */
@RestController
@RequestMapping("/webSocket")
public class SocketController {

    @Autowired
    private ExamService examService;

    @GetMapping("index")
    public ModelAndView index(){
        ModelAndView mv=new ModelAndView();
        mv.setViewName("index");
        return mv;
    }


    @ApiOperation("测试2")
    @PostMapping("test02")
    public boolean test02(@RequestBody StudentConnection studentConnection){
        return examService.updateExamStudentConnectionForFeign(studentConnection);
    }
}
